package main

import (
	"fmt"
	"myLive/client"
	"myLive/server"
	"strings"
	"time"
)

func init() {

}

func main() {
	println("Input 'join' to join a room or input 'create' to create a room.")
	fmt.Print("> ")

	var option string
	if _, err := fmt.Scan(&option); err != nil {
		return
	}

	option = strings.TrimSpace(option)

	if option == "join" {
		fmt.Print("IP of room joined:> 127.0.0.1\n")
		//var roomIP string
		//if _, err := fmt.Scan(&roomIP); err != nil {
		//	return
		//}
		//
		//roomIP = strings.TrimSpace(roomIP)
		time.Sleep(time.Second)
		client.JoinLive()

	} else if option == "create" {
		fmt.Println("listening...")

		server.OpenMyLive()

	} else {
		fmt.Println("Invalid Command.")
	}
}
